#!/usr/bin/env python
# -*-coding:utf-8-*-
# File    : liyuqi.py
# Date    : 2021-01-23
# Author  : Tom.Lee

primeNumbers = []
spcNum = 0
for n in range(2, 100):
    for x in range(2, n+1):
        if (n % x == 0):
            if x != n :
                break
            primeNumbers.append(n)
            if n < 10:
                spcNum += n

print(primeNumbers)
print(spcNum **2)

#列表推导求和再取平方
print(sum(num for num in primeNumbers if num<10) ** 2)


# 请写一个程序，请使用requests库请求兔展主页，并保存为html文件。

import requests
requests.packages.urllib3.disable_warnings()


url = "https://www.rabbitpre.com/"
resp = requests.get(url, verify=False)
with open('liyuqi.html','w') as fs:
    fs.write(resp.text)
